﻿/*
 * Copyright © 2020, Wuxi Safover Intelligent Technology Co., Ltd. All rights reserved.
 * 
 * 无锡安永智能科技有限公司版权所有，未经许可，不得用于商业用途
 * 
 * Visit: https://www.safover.com/ 
 */

using Newtonsoft.Json;
using System;
using System.Net;

namespace Safover.LidarCollector.Models
{
    public class AcquisitionCardConfig 
    {
        public static string JsonFileName => "AcquisitionCardConfig.json";
        
        /// <summary>
        /// 因设计缺陷，目前需要通过id获取通道名称
        /// </summary>
        /// <returns></returns>
        public string GetChannelName(int channelId)
        {
            switch (channelId)
            {
                case 0: return Channel1Name;
                case 1: return Channel2Name;
                case 2: return Channel3Name;
                case 3: return Channel4Name;
                default:
                    throw new ArgumentOutOfRangeException($"Unconfigured channel name for channel ID={channelId}");
            }
        }

        public int Port { get; set; } = 5000;

        [JsonConverter(typeof(IPAddressConverter))]
        public IPAddress ClientIP { get; set; } = IPAddress.Parse("192.168.100.120");

        [JsonConverter(typeof(IPAddressConverter))]
        public IPAddress HostIP { get; set; } = IPAddress.Parse("192.168.100.123");

        
        public string Channel1Name { get; set; }
        public string Channel2Name { get; set; }
        public string Channel3Name { get; set; }
        public string Channel4Name { get; set; }

        public double SpatialResolution { get; set; } = 7.5;

        public int SamplingDepth { get; set; } = 3000;

        public int CumulativePulses { get; set; } = 2000;
    }

}
